<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsCategoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_category', function (Blueprint $table) {
            $table->increments('id');
            $table->string("name",20)->default('')->comment('分类名称');
            $table->string("en_name",20)->default('')->comment('分类英文名称');
            $table->string("short_name",10)->default('')->comment('简称');
            $table->string("image_url",150)->default('')->comment('分类图片');
            $table->integer("parent_id")->default(0)->comment('父类ID');
            $table->string("parent_all",50)->default('')->comment("所有父级分类，按“,”分割，分类从小到大，如：1,2,3");
            $table->smallInteger("sort")->default(0)->comment('排序  从小到大');
            $table->tinyInteger("is_hot")->default(0)->comment('是否热门分类 0 否 1是');
            $table->tinyInteger("is_deleted")->default(0)->comment("是否删除 0否 1是");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_category');
    }
}
